home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr47 / qfml10.zip / QFML.H < prev    next >
C/C++ Source or Header  |  1995-01-31  |  5KB  |  173 lines

  1. /*
  2.  QFM (Quick Flat Memory) Manajer
  3.  (C)opyright 1995 by Render of ACC TEAM
  4.  UNREGISTERED VERION
  5. */
  6.  
  7. #ifndef __QFML_H
  8. #define __QFML_H
  9.  
  10.  
  11. /* ==================================================
  12.  Start 32-bit plane mode
  13.  Parameters: None
  14.  Returns: 0 if success
  15.           1 ERROR getting himmem address
  16.           2 ERROR enabling A20
  17.           3 ERROR CPU already under prottected mode
  18.           4 ERROR CPU running under DPMI, cannot intialize.
  19. ===================================================== */
  20. extern "C" unsigned int  StartPL   (void);
  21.  
  22.  
  23.  
  24. /* ==================================================
  25.  Leave 32-bit plane mode
  26.  Parameters: None
  27.  Returns: 0 if success
  28.       1 ERROR Himem was used to start plane mode
  29.           but it can not be found now.
  30.       2 ERROR Himem was used to start plane mode
  31.           but cannot find it's address now.
  32.       3 ERROR Trying to disable a20
  33. ===================================================== */
  34. extern "C" unsigned int  LeavePL   (void);
  35.  
  36.  
  37.  
  38. /* ==================================================
  39.  Open all memory available past the first Mg
  40.  Parameters: None
  41.  Returns: 0 if success
  42.       1 ERROR Getting max. block size
  43.       2 ERROR Getting max. block.
  44.       3 ERROR Locking max. block to get its address
  45. ===================================================== */
  46. extern "C" unsigned int  OpenMem   (void);
  47.  
  48.  
  49.  
  50. /* ==================================================
  51.  Close all memory reserved by OpenMem
  52.  Parameters: None
  53.  Returns: 0 if success
  54.       1 ERROR Trying to unlock block of memory.
  55.       2 ERROR Deallocking block of memory.
  56. ===================================================== */
  57. extern "C" unsigned int  CloseMem  (void);
  58.  
  59.  
  60.  
  61. /* ==================================================
  62.  Moves blocks of memory in plane mode. Size can be
  63.  anything from 0 bytes to 2^32 bytes.
  64.  
  65.  Parameters: 1º Source offset. A 32 bit offset
  66.         pointing to the block of memory
  67.         defining source.
  68.          2º Destination offset. A 32 bit
  69.         offset pointing to the block
  70.         of memory to be used as destination.
  71.          3º Number of bytes to be moved.
  72.         A 32-bit number ranging from 0 to 2^32.
  73.  
  74.  Returns: A long integer representing a 32-bit offset
  75.       which is the last address used as destination+1.
  76. ===================================================== */
  77. extern "C" unsigned long Pl2Pl     (unsigned long ,unsigned long ,unsigned long);
  78.  
  79.  
  80.  
  81. /* =====================================================================
  82.  Moves blocks of memory in plane mode. Size can be
  83.  anything from 0 bytes to 2^32 bytes. This one is
  84.  for asm coding (parameters passed by registers).
  85.  
  86.  Parameters: ESI a 32-bit pointer offset pointing the source.
  87.          EDI a 32-bit pointer offset pointing the destination.
  88.          EBX a 32-bit integer containing the number of bytes to move
  89.  
  90.  Returns: EDI Last destination used + 1.
  91. ======================================================================== */
  92.  
  93. extern "C" unsigned long Pl2Pla    (void); // ## ensamblador
  94.  
  95.  
  96.  
  97. /* ==================================================
  98.  Translates a memory address in the form of seg:off
  99.  to an offset of 32 bits.
  100.  
  101.  Parameters: 1º SEGMENT
  102.          2º OFFSET
  103.  
  104.  Returns: OFFSET as a 32-bit number.
  105. ===================================================== */
  106. extern "C" unsigned long VirToPL   (unsigned int, unsigned int);
  107.  
  108.  
  109.  
  110. /* ==================================================
  111.  Translates a memory address in the form of seg:off
  112.  to an offset of 32 bits. This one is for asm coders.
  113.  Parameters passed by registers.
  114.  
  115.  Parameters: AX=SEGMENT
  116.          BX=OFFSET
  117.  
  118.  Returns: EAX= OFFSET as a 32-bit number.
  119. ===================================================== */
  120.  
  121. extern "C" unsigned long VirToPLa  (void); // ## ensamblador
  122.  
  123.  
  124.  
  125. /* ==================================================
  126.  Gives the start address of the memory block reserved
  127.  by OpenMem.
  128.  
  129.  Parameters: None
  130.  Returns: OFFSET to the start of the memory block allocated
  131.       by OpenMem.
  132. ===================================================== */
  133. extern "C" unsigned long GiveSta   (void);
  134.  
  135.  
  136.  
  137. /* ==================================================
  138.  Get the amount of memory reserved by OpenMem()
  139.  Parameters: None
  140.  Returns: Number of Kilobytes allocated by OpenMem.
  141. ===================================================== */
  142. extern "C" unsigned int  GiveAmo   (void);
  143.  
  144.  
  145.  
  146. /* ==================================================
  147.  These are the usual poke functions, ranging from
  148.  byte to dword.
  149.  
  150.  Parameters: 1º OFFSET of memory to poke
  151.          2º DATA to poke.
  152.  
  153.  Returns: DATA poked.
  154. ===================================================== */
  155. extern "C" unsigned int  Pokeb     (unsigned long , unsigned char);
  156. extern "C" unsigned int  Pokew     (unsigned long , unsigned word);
  157. extern "C" unsigned int  Pokedw    (unsigned long , unsigned dword);
  158.  
  159.  
  160.  
  161. /* ==================================================
  162.  These are the usual peek functions, ranging from
  163.  byte to dword.
  164.  
  165.  Parameters: 1º OFFSET of memory to poke
  166.  
  167.  Returns: DATA peeked.
  168. ===================================================== */
  169. extern "C" unsigned char Peekb     (unsigned long );
  170. extern "C" unsigned int  Peekw     (unsigned long );
  171. extern "C" unsigned long Peekdw    (unsigned long );
  172.  
  173. #endif